package com.android.gufengmall.admin;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.fragment.app.Fragment;

import com.android.gufengmall.R;

/**
 * 文章管理
 */
public class ArticleManagerFragment extends Fragment{

    private static final String TAG = "ArticleManagerFragment";

    private Button mBtnCulture;
    private Button mBtnApparel;
    private Button mBtnFolkCraft;
    private Button mBtnTalent;

    public static ArticleManagerFragment newInstance() {
        return new ArticleManagerFragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_article_manager, container, false);
        initView(view);
        initListener();
        return view;
    }

    private void initListener() {
        mBtnCulture.setOnClickListener(v -> {
            startActivity(new Intent(requireContext(),CultureManagerActivity.class));
        });
        mBtnApparel.setOnClickListener(v -> {
            startActivity(new Intent(requireContext(), ApparelManagerActivity.class));
        });
        mBtnFolkCraft.setOnClickListener(v -> {
            startActivity(new Intent(requireContext(), FolkCraftManagerActivity.class));
        });
        mBtnTalent.setOnClickListener(v -> {
            startActivity(new Intent(requireContext(), TalentManagerActivity.class));
        });
    }

    private void initView(View view) {
        mBtnCulture = view.findViewById(R.id.btn_culture);
        mBtnApparel = view.findViewById(R.id.btn_apparel);
        mBtnFolkCraft = view.findViewById(R.id.btn_folkCraft);
        mBtnTalent = view.findViewById(R.id.btn_talent);
    }
}